﻿<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
    TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>RoboZZle online puzzle game</title>
    <style type="text/css">
        A { color: #D0D0D0 }
        P 
        {
        	color: #FFFFFF;
        	font-family: Verdana, Geneva, Arial, sans-serif;
        }
        H1,H2,H3 
        {
        	color: #FFFFFF;
    		font-family: Verdana, Geneva, Arial, sans-serif;
        }
        #horizon        
        {
            text-align: center;
            position: absolute;
            top: 50%;
            left: 0px;
            width: 100%;
            height: 1px;
            overflow: visible;
            visibility: hidden;
            display: block
        }

        #content    
        {
            margin-left: -460px;
            position: absolute;
            top: -327px;
            left: 50%;
            width: 920px;
            height: 655px;
            visibility: visible
        }

        #footer 
	        {
	        font-size: 11px;
	        text-align: center;
	        position: absolute;
	        bottom: 0px;
	        left: 0px;
	        width: 100%;
	        height: 30px;
	        visibility: visible;
	        display: block
	        }        
    </style>       
</head>
<%
    int puzzleId;
    if (int.TryParse(Request.Params["puzzle"], out puzzleId))
    {
         string initParams = "puzzleId=" + puzzleId;
         string programArg = Request.Params["program"];
         if (programArg != null)
         {
             initParams += ",program=" + programArg;
         }
         Xaml1.InitParameters = initParams;
    }
%>
<script type="text/javascript" src="Splash/SplashScreen.js"></script>
<body style="height:100%;margin:0;background-color:#484848">
    <div id="horizon">
        <div id="content">
            <form id="form1" runat="server" style="height:655px; width:920px">
                <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                <div  style="height:100%">
                    <asp:Silverlight
                        ID="Xaml1" runat="server" Source="~/ClientBin/RoboZZle.xap" MinimumVersion="2.0.30523" 
                        Width="100%" Height="100%" style="margin: 0 auto;" 
                        SplashScreenSource="Splash/Splash.xaml" OnPluginSourceDownloadProgressChanged="onSourceDownloadProgressChanged"
                        PluginBackground="#484848" ScaleMode="Zoom">
                        <PluginNotInstalledTemplate>
                            <div style="margin: 0 auto; width: 600px; height: 655px; background:#333">
                                <p>&nbsp;</p>
                                <h3 style="margin: 0 auto">RoboZZle requires Silverlight</h3>
                                <p>Robozzle is a robot-programming game. Here is a video:</p>

                                <object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/MmqBVWi_Pc0&hl=en&fs=1&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/MmqBVWi_Pc0&hl=en&fs=1&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
                                <p>&nbsp;</p>
                                <p>To play RoboZZle, install Microsoft Silverlight:</p>
                                <div style="margin: 0 auto">
                                    <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
                                    <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
                                    </a>
                                </div>
                            </div>
                        </PluginNotInstalledTemplate>
                    </asp:Silverlight>
                </div>
            </form>
        </div>        
    </div>    
    <div id="footer">
        <p>By <a href="http://igoro.com">Igor Ostrovsky</a>. <a href="/tou.aspx">Terms of use</a></p>
    </div>      
</body>
</html>
